package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲字符的输入流来读入数据
 *
 * */
public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("pw.txt");
        InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
        BufferedReader br = new BufferedReader(isr);
        /*
             String readLine();
             读取一行字符串，返回的字符串中不包含最后的换行符
             如果单独读取
        */
        String line ;
        while ((line = br.readLine()) != null){
            System.out.println(line);//换行输出
            //System.out.print(line);//没有换行操作
        }
        br.close();


    }
}
